package com.kc.business.service.impl;

import com.kc.business.domain.BizScenicFaceDevice;
import com.kc.business.mapper.BizScenicFaceDeviceMapper;
import com.kc.business.service.IBizScenicFaceDeviceService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @ClassName BizScenicFaceDeviceServiceImpl
 * @Description 设备管理service实现
 * @Author wangdongliang
 * @Date 2021/6/2 9:11
 */
@Service
public class BizScenicFaceDeviceServiceImpl implements IBizScenicFaceDeviceService {
    @Resource
    private BizScenicFaceDeviceMapper scenicFaceDeviceMapper;
    @Override
    public List<BizScenicFaceDevice> getList(BizScenicFaceDevice bizScenicFaceDevice) {
        return scenicFaceDeviceMapper.getList(bizScenicFaceDevice);
    }

    @Override
    public Integer add(BizScenicFaceDevice bizScenicFaceDevice) {
        bizScenicFaceDevice.setCreateTime(LocalDateTime.now());
        bizScenicFaceDevice.setUpdateTime(LocalDateTime.now());
        return scenicFaceDeviceMapper.insert(bizScenicFaceDevice);
    }

    @Override
    public Integer update(BizScenicFaceDevice bizScenicFaceDevice) {
        bizScenicFaceDevice.setUpdateTime(LocalDateTime.now());
        return scenicFaceDeviceMapper.updateByPrimaryKeySelective(bizScenicFaceDevice);
    }
}
